Rounds this instance’s position to the nearest multiple of grid_x/grid_y on each axis. 0 or a negative value leaves that axis untouched.
move_snap(grid_x, grid_y)| Name | Type |
|---|---|
grid_x | real |
grid_y | real |
Nothing.
Rounds this instance's position to the nearest multiple of grid_x/grid_y on each axis - landing it on a grid cell boundary rather than wherever it happened to stop. Passing 0 or a negative value for either axis leaves that axis untouched, so a single-axis snap is a plain, direct call rather than a special case.
move_snap(16, 16);Snaps the walker onto the nearest 16-pixel grid intersection on both axes - useful once movement should always end up on a cell boundary, a puzzle game's own tile-locked step rather than free pixel movement.